/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "INSTITUCIONES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Instituciones.findAll", query = "SELECT i FROM Instituciones i"),
    @NamedQuery(name = "Instituciones.findByIdInstitucion", query = "SELECT i FROM Instituciones i WHERE i.idInstitucion = :idInstitucion"),
    @NamedQuery(name = "Instituciones.findByNomInstitucion", query = "SELECT i FROM Instituciones i WHERE i.nomInstitucion = :nomInstitucion")})
public class Instituciones implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_INSTITUCION")
    private BigDecimal idInstitucion;
    @Size(max = 50)
    @Column(name = "NOM_INSTITUCION")
    private String nomInstitucion;

    public Instituciones() {
    }

    public Instituciones(BigDecimal idInstitucion) {
        this.idInstitucion = idInstitucion;
    }

    public BigDecimal getIdInstitucion() {
        return idInstitucion;
    }

    public void setIdInstitucion(BigDecimal idInstitucion) {
        this.idInstitucion = idInstitucion;
    }

    public String getNomInstitucion() {
        return nomInstitucion;
    }

    public void setNomInstitucion(String nomInstitucion) {
        this.nomInstitucion = nomInstitucion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idInstitucion != null ? idInstitucion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Instituciones)) {
            return false;
        }
        Instituciones other = (Instituciones) object;
        if ((this.idInstitucion == null && other.idInstitucion != null) || (this.idInstitucion != null && !this.idInstitucion.equals(other.idInstitucion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.Instituciones[ idInstitucion=" + idInstitucion + " ]";
    }
    
}
